public abstract class ClosedFigure extends Figure implements Area, Comparable<ClosedFigure>
{
    protected String shape;

    protected ClosedFigure(String shape,Point p1)
    {
        super(p1);
        this.shape=shape;
    }

    protected ClosedFigure()
    {
        this("",new Point());
    }

    public abstract double perimeter();

    public abstract Figure revolve(double angle);
    public abstract Figure revolve(Point p,double angle);

    public abstract Figure zoom(double percentage);
    public abstract Figure zoom(Point p,double percentage);

    public void print()
    {
        System.out.println(this.shape+this+","+String.format("周长%1.2f，面积%1.2f",this.perimeter(),this.area()));
    }

    public String toString()
    {
        return "ClosedFigure{"+
                "shape='"+shape+'\''+
                ", point1="+point1+
                '}';
    }
    public int compareTo(ClosedFigure cFig)
    {
        double a1=this.area();
        double a2=cFig.area();
        return  a1<a2?-1:a1>a2?1:0;
    }
    public abstract boolean contains(Point p);
}
